'''
@Owner dYrolign and DERFDY 2025.
@Author dYrolign.
@Contibutor iKeinsan, Werstog, Leoitsenn.
@Date 2025/10/15.
'''

n=int(input("请输入评委数：\n"))
sum = 0.0
average = 0.0
scores = []

def list_average(list:list):
    sum = 0.0
    for i in list:sum+= i
    return sum/len(list)

for x in range(n):
    scores.append(float(input("请输入评分：\n")))

scores.sort()
scores.pop(0)
scores.pop(-1)

average = list_average(scores)

print('选手最终成绩为：{0:.2f}'.format(average))